import axios from "@/utils/request.js";

/**
 * 添加训练记录
 * @param {*} trainRecordInfo 
 * @returns 
 */
export const trainRecordAddService = (trainRecordInfo) => {
    return axios.post("/trainRecordInfo/add",trainRecordInfo)
}

/**
 * 批量添加训练记录
 * @param {*} trainRecordInfo 
 * @returns 
 */
export const trainRecordAddBatchService = (trainRecordInfo) => {
    return axios.post("/trainRecordInfo/addBatch",trainRecordInfo)
}

/**
 * 分页查询训练记录信息
 * @param {*} pageNo 
 * @param {*} pageSize 
 * @param {*} trainNameFuzzy 
 * @param {*} userNameFuzzy 
 * @param {*} titleNameFuzzy 
 * @returns 
 */
export const trainRecordSelectService = (pageNo,pageSize,trainNameFuzzy,userNameFuzzy,titleNameFuzzy) => {
    return axios.get("/trainRecordInfo/loadDataList",{params:{
        pageNo,pageSize,trainNameFuzzy,userNameFuzzy,titleNameFuzzy,orderBy: 'create_time desc'
    }})
}

/**
 * 根据trainRecordId修改训练记录信息
 * @param {*} trainRecordInfo 
 * @returns 
 */
export const trainRecordModifyService = (trainRecordInfo) => {
    return axios.put("/trainRecordInfo/updateTrainRecordInfoByRecordId",trainRecordInfo)
}

/**
 * 根据训练记录id删除训练记录信息
 * @param {*} recordId 
 * @returns 
 */
export const trainRecordDeleteService = (recordId) => {
    return axios.delete("/trainRecordInfo/deleteTrainRecordInfoByRecordId",{params:{
        recordId
    }})
}

